<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${ painting.title!''}_可观艺术</title>
<meta name="Keywords" content="${ painting.title!''},作品详情,当代画家作品鉴赏,可观艺术" />
<meta name="Description" content="${ painting.title!''}鉴赏,大图,高清图片鉴赏" />
<link href="${ctx}/style/common.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/style/painting.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#content{text-align: left;width:960px;margin: 0 auto;border:1px solid #cccccc;background: #ffffff;margin-top: 5px;}

#ciyi_top{width: 670px;margin-left: 23px;}
#ciyi_center{width: 960px;}
#ciyi_bottom{height: 55px;}
#ciyi_left{float: left;padding: 0px 10px 0px 25px;}
#ciyi_middle{float: left;width: 630px;height: 630px;border: 1px solid #ccc;position:relative;}
#ciyi_right{float: left;}

.preImg{position:absolute; left:0px;top:0px;z-index:101;width: 20%;height: 100%;}
.nextImg{position:absolute; right:0px; top:0px;z-index:102;width: 20%;height: 100%;}

.newItem{padding: 5px 0px 5px 25px;font-size: 14px;color: #333333;}
#relativeList_div{width:960px;margin: 0 auto;border:1px solid #cccccc;margin-top: 4px;background: #ffffff}
.ciyi_pic{position: absolute;width: 618px;height: 618px;background: center center;margin-top: 6px;margin-left: 6px;background-repeat: no-repeat;}
.title_ciyi{font-size: 12px;}

.tips{width: 273px;height: 111px;background: url('${ctx }/images/ciyi/ts.png') no-repeat;position: absolute;z-index:2;display: none;left:-25px;top:-115px;font-size: 12px;}

.size_control_img_checked{cursor: pointer;border: 1px solid red;}
.size_control_img{cursor: pointer;}
.painter_outer{background-color:#cccccc;width: 76px;height: 90px;float:left;cursor: pointer;margin-left:15px;margin-top: 10px;}
.painter_outer:hover{background-color:#ff9900;}
</style>

<script type="text/javascript" src="${ctx }/js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(function(){
 $("#subscribe_link").hover(function() {
  $(".tips").animate({opacity: "show", top: "-100"}, "slow");
 }, function() {
	 $(".tips").animate({opacity: "hide", top: "-105"}, "fast");
 });
});
</script>
</head>
<body>

<div id="_link_div_win" style="display:none;z-index:1001;margin:auto;position: absolute;font-size: 12px;"></div>

<#include "/commons/head.ftl"/>

	<div id="content">
		<div id="ciyi_top">
				<#if ( painting.onSaleFlag?exists && painting.onSaleFlag == '2') && (painting.store?exists && painting.store == 0) >
					<div style="float: left;padding-top: 15px;">
						<div style="text-align:center;width: 90px;height:29px;padding-top:10px;color: #ffffff;font-size: 15px;font-weight: bold;background-repeat: no-repeat;background: url('../images/ciyi/sale_bg.png');">售罄</div>
					</div>
				</#if>
			<div style="float:left;font-family: 黑体;font-size: 22px;text-align: center;width: 570px;padding: 20px 0px 20px 0px;">
				${painting.title }
			</div>
			<div style="clear: both;"></div>
		</div>
		<div id="ciyi_center">
			<div id="ciyi_left">
				<div class="size_control_img"><img src="${ctx}/images/ciyi/da.jpg" border="0"/></div>
				<div style="margin-top: 15px;" class="size_control_img_checked"><img src="${ctx}/images/ciyi/zhong.jpg" border="0"/></div>
				<div style="margin-top: 15px;" class="size_control_img"><img src="${ctx}/images/ciyi/xiao.jpg" border="0"/></div>
			</div>
			<div id="ciyi_middle">
				<div class="preImg" title="浏览该作者上一幅作品" style="cursor:url(${ctx}/images/arr_left.cur),auto; "></div>
				<div class="nextImg" title="浏览该作者下一幅作品" style="cursor:url(${ctx}/images/arr_right.cur),auto;"></div> 
				<div style="background-image: url('${painting.middleImageBpath }');" class="ciyi_pic"></div>
			</div>
			<div id="ciyi_right">
				<div id="qqxl_div" style="height: 33px;font-size: 24px;font-family: 黑体;padding-left: 22px;">
					<#if painting.qqxl?exists && (painting.qqxl > 0)>
						全球限量<span style="color: red">${painting.qqxl!'' }</span>${painting.unit2!'' }
					</#if>
				</div>
				<div id="description">
					<div class="newItem">作品编号：KGCY${painting.id }</div>
					<div class="newItem">材质：${painting.caiZhi }</div>
					<div class="newItem">规格：<#if painting.width?exists>长${painting.width}cm&nbsp;</#if><#if painting.hight?exists>宽${painting.hight}cm&nbsp;</#if><#if painting.altitude?exists>高${painting.altitude}cm</#if></div>
					<#if painting.painter?exists>
						<div class="newItem">创作者：<a href="${ctx }/${painting.painter.linkUrl }" style="text-decoration: underline;">${painting.painter.name }</a>
	           				<#if painting.zhengshu?exists><a href="${painting.zhengShuImagePath }" target="_blank" style="text-decoration: underline;">查看证书</a></#if>
						</div>
					</#if>
					<div class="newItem">物流：卖方承担</div>
					<div class="newItem">提供方：${painting.provider!'' }</div>
				</div>
				<#if painting.onSaleFlag?exists && painting.onSaleFlag == '2'>
					<#if goods.price?exists><div class="newItem">可观价：<span style="color: red">￥${goods.price?string("#.##") }</span>元</div></#if>
					<#if goods.mktprice?exists><div class="newItem">促销价：<span style="color: red">￥${goods.mktprice?string("#.##") }</span>元</div></#if>
					<#if goods.store?exists><div class="newItem">库存量：<span style="color: red;">${goods.store }</span>&nbsp;${goods.unit }</div></#if>
					<div class="newItem">
						<div style="float: left;">
							<img src="${ctx}/images/ciyi/wym.jpg" border="0"/>
							<img src="${ctx}/images/ciyi/jian.jpg"  onclick="changenum_goods(-1)" style="cursor:pointer;"  border="0"/>
						</div>
						<div style="float: left;padding-top: 5px;">
							<input type="text" name="num_goods_buy" id="num_goods_buy" value="1" style="width: 60px;border: 1px solid #ccc;"/>
						</div>
						<div style="float: left;">
							<img src="${ctx}/images/ciyi/jia.jpg"  onclick="changenum_goods(1)" style="cursor:pointer;"  border="0"/>
						</div>
						<div style="clear: both;"></div>
					</div>
					<div class="newItem">
							<#if ( painting.store?exists && painting.store > 0 )><img src="${ctx}/images/ciyi/dg.jpg" width="131" height="44" style="cursor:pointer;" onclick="onbuy()"/>
							<#else><img src="${ctx}/images/ciyi/dg2.jpg" width="131" height="44"/></#if>
					</div>
					<div id="subscribe_div" style="width: 200px;padding: 20px 0px 0px 25px;position: relative;margin: 0px;">
						<#if subscribeFlag?exists && subscribeFlag == '1' >
								<div style=""><a style="text-decoration: underline;cursor: pointer;width: 90px;height: 45px;display: block;" id="subscribe_link">预约电话</a></div>
								<div class="tips">
									<p style="text-align: center;padding-top: 15px;margin: 0;">如需预约作者，品鉴原画请致电</p>
									<p style="text-align: center;color: red;padding-top: 15px;margin: 0;">0755-86292234</p>
									<p style="text-align: center;padding-top: 15px;margin: 0;">温馨提示：本服务按作品价钱的15%收取介绍费</p>
								</div>
						</#if>
					</div>
				</#if>
				
				<div id="other_pics" style="width: 200px;position: absolute;margin-left: 10px;">
					<#if painting.imageInfo?exists >
						<div class="painter_outer"><div style='margin-top:4px;margin-left:5px;width: 66px;height: 82px;background-position: center center;background-image: url("${painting.tinyImagePath }");background-repeat:no-repeat;'><a style="display:block;width:66px;height:82px;"></a></div></div>
					</#if>
					<#if painting.imageInfo2?exists >
						<div class="painter_outer"><div style='margin-top:4px;margin-left:5px;width: 66px;height: 82px;background-position: center center;background-image: url("${painting.tinyImagePath2 }");background-repeat:no-repeat;'><a style="display:block;width:66px;height:82px;"></a></div></div>
					</#if>
					<#if painting.imageInfo3?exists >
						<div class="painter_outer"><div style='margin-top:4px;margin-left:5px;width: 66px;height: 82px;background-position: center center;background-image: url("${painting.tinyImagePath3 }");background-repeat:no-repeat;'><a style="display:block;width:66px;height:82px;"></a></div></div>
					</#if>
					<#if painting.imageInfo4?exists >
						<div class="painter_outer"><div style='margin-top:4px;margin-left:5px;width: 66px;height: 82px;background-position: center center;background-image: url("${painting.tinyImagePath4 }");background-repeat:no-repeat;'><a style="display:block;width:66px;height:82px;"></a></div></div>
					</#if>
				</div>
			   </div>
			<div style="clear: both;"></div>
		</div>
		<div id="ciyi_bottom"></div>
	</div>
	
	<div id="relativeList_div">
		<div style="font-size: 14px;padding: 5px 0px 5px 35px;">相关作品</div>
		<#list relativeList as result >
			<#include "/commons/ciyi_fragment.ftl"/>
		</#list>
	</div>

<form id="orderForm" name="orderForm" action="${ctx }/customer/order!orderPrepare.do" method="post">
	<input type="hidden" value="${(goods.id)!'' }" name="gId" id="gId"/>
	<input type="hidden" value="1" name="num" id="num"/>
</form>	

<#include "/commons/foot.ftl"/>

<script type="text/javascript">

/**** 距滚动条顶部距离 *******/
function getScrollTop(){
	var scrollPos; 
	if (typeof window.pageYOffset != 'undefined') { 
	   scrollPos = window.pageYOffset; 
	} 
	else if (typeof document.compatMode != 'undefined' && 
	     document.compatMode != 'BackCompat') { 
	   scrollPos = document.documentElement.scrollTop; 
	} 
	else if (typeof document.body != 'undefined') { 
	   scrollPos = document.body.scrollTop; 
	}
	return  scrollPos;
}

function createPopupDiv(divId,width,height,content){

	var divWindow = document.getElementById(divId);
	divWindow.style.display = "block";
	divWindow.style.width = width +"px";
	divWindow.style.height  = height + "px" ;
	var scrollTop = getScrollTop() ;
	divWindow.style.left = (document.body.offsetWidth - width)/2 + document.body.scrollLeft + "px";
	divWindow.style.top  = (window.screen.availHeight - height) / 2 + scrollTop + "px";
	divWindow.innerHTML = content;
}

function closePopupDiv(divId){

	var divWindow = document.getElementById(divId);
	divWindow.style.display = "none";
}

function changenum_goods(flag){
	var _oldnum = $("#num_goods_buy").val() ;
	_oldnum = parseInt(_oldnum,"10")
	var _num = _oldnum + flag;
	var _store  = '${(goods.store)!''}';
	if( _num < 1 ){
		alert("选购商品数量最少为1。");
		_num  = 1;
	}else {
		var _store = parseInt(_store);
		if( _num > _store ){
			alert("选购商品数量不能超过库存数量。");
			_num = _store;
	       }
		}
	$("#num_goods_buy").val(_num);
	$("#num").val(_num);
}

function onbuy(){
	$.ajax( {
		type : "POST",
		url : "${ctx}/customer/order!checkL.do?time="+new Date(),
		timeout : 6000,
		async : false, 
		success : function(data, textStatus) {
			if(data  == "0000"){
				var num_goods = $("#num_goods_buy").val();
				$("#num").val(num_goods);
				$("#orderForm").submit();
			}
			else{
				var link_url = "${ctx}/user/login_fragment.jsp";
				var width = 383;
				var height = 265;
				var content = '<iframe src="'+link_url+'" width="383" height="264" frameborder="0" marginheight="0" marginwidth="0">';
				createPopupDiv("_link_div_win",width,height,content);
			}
		}
	});
}
var index_images = 0;//图片序列
var imagesArray = ${imagesArray};
$(function(){

	$("#ciyi_left>div").live("click",function(){
		    var index_size_btn=$("#ciyi_left>div").index($(this));
	
		    if(imagesArray.length <= 0){
		    	return;
		    }
		    var imgpath = imagesArray[index_images].bigImagePath;
			if( index_size_btn == 2 ){
				imgpath = imagesArray[index_images].smallImagePath;
			}
			else if( index_size_btn == 1 ){
				imgpath = imagesArray[index_images].middleImageBpath;
			}
			else{
				imgpath = imagesArray[index_images].bigImagePath;
			}
			
			$(".size_control_img_checked").addClass("size_control_img").removeClass("size_control_img_checked");
			$(this).addClass("size_control_img_checked");
	
			$(".ciyi_pic").css("background-image","url('"+imgpath+"')");
			$(".ciyi_pic").css("background-repeat","no-repeat");
	});
	
	$(".painter_outer").live("click",function(){
	   index_images = $(".painter_outer").index($(this));
	   $("#ciyi_left>div").eq(1).trigger("click");
    });
	
	$(".preImg").click(function(){
			if("${preUrl}"==""){
				alert("已经浏览至该作品集第一幅作品。");
				return ;
			}
			location.href = "${ctx}/${preUrl}";
		});
		
	$(".nextImg").click(function(){
			if("${nextUrl}" == ""){
				alert("已经浏览至该作品集最后一幅作品。");
				return;
			}
			location.href = "${ctx}/${nextUrl}";
		});

});
</script>
</body>

</html>